package org.monitor.servlet.base;

public class Resource {
	
	  public static final String METHOD_DELETE = "DELETE";
	  
	  public static final String METHOD_HEAD = "HEAD";
	  
	  public static final String METHOD_GET = "GET";
	  
	  public static final String METHOD_OPTIONS = "OPTIONS";
	  
	  public static final String METHOD_POST = "POST";
	  
	  public static final String METHOD_PUT = "PUT";
	  
	  public static final String METHOD_TRACE = "TRACE";
	
	private String method;
	private String resource;
	
	void setMethod(String method){
		this.method = method;
	}
	
	void setResource(String resource){
		this.resource = resource;
	}
	
	public boolean isGet(){
		if(METHOD_GET.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isPut(){
		if(METHOD_PUT.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isPost(){
		if(METHOD_POST.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isDelete(){
		if(METHOD_DELETE.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isTrace(){
		if(METHOD_TRACE.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isHead(){
		if(METHOD_HEAD.equals(method)){
			return true;
		}
		return false;
	}
	
	public boolean isOptions(){
		if(METHOD_OPTIONS.equals(method)){
			return true;
		}
		return false;
	}

	public String getResource() {
		return resource;
	}
	
}
